﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// 日志记录类
/// </summary>
public class LogRecord
{
    public static log4net.ILog log = null;
	public LogRecord()
	{
		//
		//TODO: 在此处添加构造函数逻辑
		//
	}

    /// <summary>
    /// 写Debug日志
    /// </summary>
    public static void Debug(string strMsg)
    {
        log = log4net.LogManager.GetLogger("debug");
        if (log != null)
        {
            log.Debug(strMsg);
        }
    }

    /// <summary>
    /// 写Info日志
    /// </summary>
    public static void Info(string strMsg)
    {
        log = log4net.LogManager.GetLogger("info");
        if (log != null)
        {
            log.Info(strMsg);
        }
    }

    /// <summary>
    /// 写Warn日志
    /// </summary>
    public static void Warn(string strMsg)
    {
        log = log4net.LogManager.GetLogger("warn");
        if (log != null)
        {
            log.Warn(strMsg);
        }
    }

    /// <summary>
    /// 写Error日志
    /// </summary>
    public static void Error(string strMsg)
    {
        log = log4net.LogManager.GetLogger("error");
        if (log != null)
        {
            log.Error(strMsg);
        }
    }

    /// <summary>
    /// 写Fatal日志
    /// </summary>
    public static void Fatal(string strMsg)
    {
        log = log4net.LogManager.GetLogger("fatal");
        if (log != null)
        {
            log.Fatal(strMsg);
        }
    }
}

/// <summary>
/// 公共类
/// </summary>
public class Common
{
    /// <summary>
    /// 科目类型
    /// </summary>
    public string strSubjectType;
    /// <summary>
    /// 科目类型
    /// </summary>
    public string SubjectType
    {
        get { return strSubjectType; }
        set { strSubjectType = value; }
    }

    static Common _instance;
    /// <summary>
    /// 获取Common实例
    /// </summary>
    /// <returns></returns>
    public static Common GetInstance()
    {
        if (_instance == null)
        {
            _instance = new Common();
        }
        return _instance;
    }
}